<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'main.jsp' starting page</title>
<link href="<%= basePath %>/manager/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%= basePath %>/common/js/jQuery-1.9.1.js"></script>
<script type="text/javascript">
	
</script>

</head>

<s:action name="findAll" namespace="/manager_roletab" />

<body>

	<div class="place">
		<span>位置：</span>
		<ul class="placeul">
			<li><a href="javascript:void(0)">首页</a></li>
			<li><a>用户管理</a></li>
			<li><a>用户列表</a></li>
		</ul>
	</div>

	<div class="rightinfo">

		<table class="tablelist">
			<thead>
				<tr>
					<%-- <th><input id="checkedAll" name="checkedAll" type="checkbox" onclick="selectAllChecked()" /></th> --%>
					<th>编号<i class="sort"><img src="<%= basePath %>/manager/images/px.gif" /></i></th>
					<th>角色名称</th>
					<th>状态</th>
					<th>备注</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${pager.datas}" var="roleTab" varStatus="i">
					<tr>
						<%-- <th><input name="checked" type="checkbox" value="${roleMenu.rmId}"/></th> --%>
						<td>${i.index+1}</td>
						<td>${roleTab.rtName}</td>
						<td>${roleTab.rtStatus == 0 ? "正常" : "禁用" }</td>
						<td>${roleTab.remark }</td>
						<td>
							<a href="javascript:location.href = 'manager_roletab/input?id=${roleTab.rtId}'" class="tablelink">修改</a>
							<a href="javascript:$('.tip').fadeIn(200);$('#deleteSubmit').attr('name',${roleTab.rtId});" class="tablelink">删除</a> 
						</td>
					</tr>
				</c:forEach>
			</tbody>
		</table>


		<pg:pager url="manager/roleTab/list.jsp" items="${pager.total}"
			export="currentPageNumber=pageNumber" maxPageItems="10"
			maxIndexPages="10">

			<div class="pagin">
				<div class="message">
					共<i class="blue">${pager.total}</i>条记录，当前显示第&nbsp;<i class="blue">${currentPageNumber}&nbsp;</i>页
				</div>
				<ul class="paginList">
					<li class="paginItem">
						<pg:prev>
							<a href="${pageUrl}"><span class="pagepre"></span></a>
						</pg:prev>
					</li>
					<pg:pages>
						<c:choose>
							<c:when test="${currentPageNumber eq pageNumber}">
								<li class="paginItem"><a style="color: red">${pageNumber}</a></li>
							</c:when>
							<c:otherwise>
								<li class="paginItem"><a href="${pageUrl }">${pageNumber}</a></li>
							</c:otherwise>
						</c:choose>
					</pg:pages>
					<li class="paginItem">
						<pg:next>
							<a href="${pageUrl}"><span class="pagenxt"></span></a>
						</pg:next>
					</li>
				</ul>
			</div>
		</pg:pager>

		<div class="tip">
			<div class="tiptop">
				<span>提示信息</span><a></a>
			</div>

			<div class="tipinfo">
				<span><img src="<%= basePath %>/manager/images/ticon.png" /></span>
				<div class="tipright">
					<p>确认对删除信息？</p>
					<cite>如果是请点击确定按钮 ，否则请点取消。</cite>
				</div>
			</div>

			<div class="tipbtn">
				<input onclick="javascript:location.href = 'manager_roletab/delete?id='+$(this).attr('name')" type="button" class="sure" value="确定" name="" id="deleteSubmit" />&nbsp; 
				<input onclick="javascript:$('.tip').fadeOut(200);" type="button" class="cancel" value="取消" />
			</div>

		</div>
	</div>
</body>
</html>